{itemplate 'public/header'}
<div class="page home" id="page-app-my-favotite">
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back" href="javascript:;"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title">我的收藏</h1>
	</header>
	{php get_mall_menu();}
	<div class="content">
		<div class="store-list" {if empty($stores)}style="position:relative;"{/if}>
		{if empty($stores)}
			<div class="common-no-con">
				<img src= "{WE7_WMALL_TPL_URL}static/img/store_no_con.png" alt="" />
				<p>您还没有收藏过店铺呢！</p>
			</div>
		{else}
			{loop $stores $store}
				<div class="list-item sborder">
					{if !empty($store['label'])}
						<span class="store-label" style="background-color: {$store['label_color']}">{$store['label_cn']}</span>
					{/if}
					<a href="{$store['url']}" class="external">
						<div class="store-info row no-gutter">
							<div class="store-img col-25">
								<img src="{php echo tomedia($store['logo']);}" alt="{$store['title']}">
								{if !$store['is_in_business_hours']}
									<span>店铺休息中</span>
								{/if}
							</div>
							<div class="col-75">
								<div class="row no-gutter">
									<div class="col-60 text-ellipsis">{$store['title']}</div>
									<div class="col-40 money-info text-right">
										{if $store['token_status'] == 1}
											<span>券</span>
										{/if}
										{if $store['invoice_status'] == 1}
											<span>票</span>
										{/if}
										<span>付</span>
									</div>
								</div>
								<div class="rel-info">
									<div class="row no-gutter">
										<div class="col-60">
											<div class="star-rank">
												<span class="star-rank-outline">
													<span class="star-rank-active" style="width:{$store['score_cn']}%"></span>
													<span class="star-rank-value">{$store['score']}</span>
												</span>
												<span class="sailed">已售 {$store['sailed']} 份</span>
											</div>
										</div>
										{if $store['delivery_mode'] == 2}
											<div class="plateform-delivery"><span>{$_config_mall['delivery_title']}</span></div>
										{/if}
									</div>
									<div class="delivery-conditions">
										起送￥{$store['send_price']}<span class="pipe">|</span>配送￥{$store['delivery_price']}<span class="pipe">|</span>约{$store['delivery_time']}分钟
									</div>
								</div>
							</div>
						</div>
					</a>
					<div class="activity-containter">
						{if $store['activity']['num'] > 0}
							<div class="dashed-line"></div>
						{/if}
						{if $store['activity']['num'] > 2}
							<div class="activity-num">{$store['activity']['num']}个活动 <i class="icon icon-arrow-down"></i></div>
						{/if}
						{loop $store['activity']['items'] $item}
							{php $num++;}
							<div class="{$item['type']} {if $num > 2}activity-row hide{/if}">
								{$item['title']}
							</div>
						{/loop}
						{if $store['delivery_free_price'] > 0}
							{php $num++;}
							<div class="activity-row free {if $num > 2}hide{/if}">
								满{$store['delivery_free_price']}元免拼车费
							</div>
						{/if}
						{if !empty($store['hot_goods'])}
							<div class="dashed-line"></div>
							<div class="hot">
								热销:
								{loop $store['hot_goods'] $good}
								{$good['title']}
								{/loop}
							</div>
						{/if}
					</div>
				</div>
			{/loop}
		{/if}
		</div>
	</div>
</div>
<script>
$(function(){
	$(document).on('click', '.activity-containter', function(){
		if($(this).hasClass('active')) {
			$(this).find('.activity-row').addClass('hide');
			$(this).find('.activity-num i').addClass('fa-arrow-down').removeClass('fa-arrow-up');
		} else {
			$(this).find('.activity-row').removeClass('hide');
			$(this).find('.activity-num i').addClass('fa-arrow-up').removeClass('fa-arrow-down');
		}
		$(this).toggleClass('active');
	});
});
</script>
{itemplate 'public/footer'}